﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;
using DataAccess;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

public class Service : System.Web.Services.WebService
{
    AdminBS bs;
    NewsBS newsbs;
    StudentBS studentbs;
    AdmissionBS admbs;
    SemesterBS Stbs;
    FacultyBS F;
    SchoolofYearBS SY;
    SchoolSubjectsBS SS;
    FeedBackBS FB;
    public Service()
    {
        bs = new AdminBS();
        newsbs = new NewsBS();
        studentbs = new StudentBS();
        admbs = new AdmissionBS();
        Stbs = new SemesterBS();
        SY = new SchoolofYearBS();
        SS = new SchoolSubjectsBS();
        F = new FacultyBS();
        FB = new FeedBackBS();
        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }
    [WebMethod]
    public List<Teacher> ShowNameTeacher()
    {
        List<Teacher> list = F.ShowNameTeacher();
        return list;
    }
    [WebMethod]
    public int CodeProfileTeachers(string NameTeachers)
    {
        int code = F.CodeProfileTeachers(NameTeachers);
        return code;
    }
    [WebMethod]
    public List<Semester> ShowSemester()
    {
        List<Semester> list = Stbs.ShowSemester();
        return list;
    }
    [WebMethod]
    public List<SchoolSubjects> ShowSubjects()
    {
        List<SchoolSubjects> list = SS.ShowSubjects();
        return list;
    }
    [WebMethod]
    public List<SchoolofYear> ShowSchoolofYear()
    {
        List<SchoolofYear> list = SY.ShowSchoolofYear();
        return list;
    }
    [WebMethod]
    public List<Faculty> ShowsFaculty()
    {
        List<Faculty> list = F.ShowsFaculty();
        return list;
    }
    [WebMethod]
    public int CodeSemester(string namesemester)
    {
        int code = Stbs.CodeSemester(namesemester);
        return code;
    }
    [WebMethod]
    public int SP_CodeProfileStudent(string UserName)
    {
        int code;
        code = studentbs.SP_CodeProfileStudent(UserName);
        return code;
    }
    [WebMethod]
    public int CodeSubjects(string NameSubjects)
    {
        int code = SS.CodeSubjects(NameSubjects);
        return code;
    }
    [WebMethod]
    public int CodeSchoolofYear(string NameSchoolofYear)
    {
        int code = SY.CodeSchoolofYear(NameSchoolofYear);
        return code;
    }
    [WebMethod]
    public string CodeFaculty(string NameFaculty)
    {
        string code = F.CodeFaculty(NameFaculty);
        return code;
    }
    [WebMethod]
    public string LoginAdmin(string ten, string pass)
    {
        string tendangnhap;
        tendangnhap = bs.LoginAdmin(ten, pass);
        return tendangnhap;
    }
    [WebMethod]
    public int Codenews(string title)
    {
        int code = newsbs.Codenews(title);
        return code;
    }
    [WebMethod]
    public List<News> ShowNewsDetails(int code)
    {
        List<News> list = newsbs.ShowNewsDetails(code);
        return list;
    }
    [WebMethod]
    public List<News> ShowNews()
    {
        List<News> list = newsbs.ShowNews();
        return list;
    }
    [WebMethod]
    public List<News> ShowTopNews()
    {
        List<News> list = newsbs.ShowTopNews();
        return list;
    }
    [WebMethod]
    public List<News> ShowTopNewsTitle()
    {
        List<News> list = newsbs.ShowTopNewsTitle();
        return list;
    }
    [WebMethod]
    public void AddNews(string title, string contentSummary, string content, string imageNews)
    {
        newsbs.AddNews(title, contentSummary, content, imageNews);
    }
    [WebMethod]
    public List<News> NewsAdmin()
    {
        List<News> list = newsbs.NewsAdmin();
        return list;
    }
    [WebMethod]
    public void DeleteNews(int CodeNews)
    {
        newsbs.DeleteNews(CodeNews);
    }
    [WebMethod]
    public string LoginStudent(string tendangnhap, string passwod)
    {
        string UserName;
        UserName = studentbs.LoginStudent(tendangnhap, passwod);
        return UserName;
    }
    [WebMethod]
    public void AddAdmission(int CodeProfileStudent, int CodeSchoolSubjects, int CodeSchoolofYear, int CodeSemester, string CodeFaculty, string FullName, string DateOfBirth, string Gender, string FatherName, string MotherName, string ResidentalAddress, string PernamentAddress)
    {
        admbs.AddAdmission(CodeProfileStudent, CodeSchoolSubjects, CodeSchoolofYear, CodeSemester, CodeFaculty, FullName, DateOfBirth, Gender, FatherName, MotherName, ResidentalAddress, PernamentAddress);
    }
    [WebMethod]
    public List<Admission> ListAdmission(int codestudent)
    {
        List<Admission> list = admbs.ListAdmission(codestudent);
        return list;
    }
    [WebMethod]
    public List<Admission> ListAdmissionTrue(int codestudent)
    {
        List<Admission> list = admbs.ListAdmissionTrue(codestudent);
        return list;
    }
    [WebMethod]
    public List<Admission> ViewAdmission()
    {
        List<Admission> list = admbs.ViewAdmission();
        return list;
    }
    [WebMethod]
    public void AddFeedBack(int CodeProfile, int CodeSchoolSubjects, int CodeProfileStudent, string Month, string Punctual, string Convered, string Skills, string Support, string Remarks)
    {
        FB.AddFeedBack(CodeProfile, CodeSchoolSubjects, CodeProfileStudent, Month, Punctual, Convered, Skills, Support, Remarks);
    }
    [WebMethod]
    public void CheckAdmissionYes(int CodeSchoolSubjects, int CodeProfileStudent)
    {
        admbs.CheckAdmissionYes(CodeSchoolSubjects, CodeProfileStudent);
    }
    [WebMethod]
    public void CheckAdmissionNo(int CodeSchoolSubjects, int CodeProfileStudent)
    {
        admbs.CheckAdmissionNo(CodeSchoolSubjects, CodeProfileStudent);
    }
    [WebMethod]
    public void CheckAdmissionWait(int CodeSchoolSubjects, int CodeProfileStudent)
    {
        admbs.CheckAdmissionWait(CodeSchoolSubjects, CodeProfileStudent);
    }
    [WebMethod]
    // sinh viên đồng ý vào nhập học
    public void Status(int CodeSchoolSubjects, int CodeProfileStudent)
    {
        admbs.Status(CodeSchoolSubjects, CodeProfileStudent);
    }
    [WebMethod]
    //
    public List<Admission> ViewAdmissionSubject(int CodeSchoolSubjects)
    {
        List<Admission> list = admbs.ViewAdmissionSubject(CodeSchoolSubjects);
        return list;
    }
    [WebMethod]
    public string StatusShow(int CodeSchoolSubjects, int CodeProfileStudent)
    {
        string status;
        status = admbs.StatusShow(CodeSchoolSubjects, CodeProfileStudent);
        return status;
    }
    [WebMethod]
    public List<EventsBS> ShowTopEvent()
    {
        List<EventsBS> list = newsbs.ShowTopEvent();
        return list;
    }
    [WebMethod]
    public List<EventsBS> ShowEvent()
    {
        List<EventsBS> list = newsbs.ShowEvent();
        return list;
    }
    [WebMethod]
    public void InertEvent(string Title, string ContentSummary, string Content, string ImageEvent, string StartTime, string TimeEnd)
    {
        newsbs.InertEvent(Title, ContentSummary, Content, ImageEvent, StartTime, TimeEnd);
    }
    [WebMethod]
    public List<EventsBS> ShowEventDetails(int codeEvent)
    {
        List<EventsBS> list = newsbs.ShowEventDetails(codeEvent);
        return list;
    }
    [WebMethod]
    public void DeleteEvent(int CodeEvent)
    {
        newsbs.DeleteEvent(CodeEvent);
    }
    [WebMethod]
    public List<FeedBack> ShowFeedBack()
    {
        List<FeedBack> list = FB.ShowFeedBack();
        return list;
    }
}